<template>
  <div>
    <HeaderTitle :title="1"></HeaderTitle>
    <HomeDavPage :categoryId="categoryId"></HomeDavPage>
  </div>
</template>

<script lang="ts">
import { defineComponent } from "vue"
export default defineComponent({
  name: 'DavPage',
})
</script>

<script lang="ts" setup>
import HomeDavPage from "@/pages/HomeDavPage/index.vue"
import HeaderTitle from "@/components/HeaderTitle/index.vue"
import { onBeforeMount } from "vue"
import { useRoute } from 'vue-router'
import { ref } from 'vue'
let categoryId = ref('109320005')
const route = useRoute()
// 子组件挂载完成后父组件才会挂载完成，所以需要写在onBeforeMount生命周期中
onBeforeMount(() => {
  // 传递点击的导航栏的categoryId
  route.query.categoryId && (categoryId.value = route.query.categoryId as string)
})



</script>

<style lang="less" scoped></style>